.\" Manual Page for Berkely DB utils, created from upstream
.\" documentation by Thijs Kinkhorst <thijs@kinkhorst.com>.
.TH DB_RECOVER 1 "28 January 2005"
.SH NAME
db_recover \- Restore the database to a consistent state
.SH SYNOPSIS
.B db_recover
[-ceVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]]
.SH DESCRIPTION
The db_recover utility must be run after an unexpected application, Berkeley
DB, or system failure to restore the database to a consistent state. All
committed transactions are guaranteed to appear after db_recover has run, and
all uncommitted transactions will be completely undone.
.SH OPTIONS
.IP \fB\-c\fR
Perform catastrophic recovery instead of normal recovery.
.IP \fB\-e\fR
Retain the environment after running recovery.  This option
will rarely be used unless a DB_CONFIG file is present in the home
directory.  If a DB_CONFIG file is not present, then the regions will be
created with default parameter values.
.IP \fB\-h\fR
Specify a home directory for the database environment; by
default, the current working directory is used.
.IP \fB\-P\fR
Specify an environment password.  Although Berkeley DB utilities overwrite
password strings as soon as possible, be aware there may be a window of
vulnerability on systems where unprivileged users can see command-line
arguments or where utilities are not able to overwrite the memory
containing the command-line arguments.
.IP \fB\-t\fR
Recover to the time specified rather than to the most current possible
date.  The timestamp argument should be in the form
[[CC]YY]MMDDhhmm[.SS] where each pair of
letters represents the following:
.RS
.IP CC
The first two digits of the year (the century).
.IP YY
The second two digits of the year.  If "YY" is specified, but "CC" is not,
a value for "YY" between 69 and 99 results in a "CC" value of 19.  Otherwise,
a "YY" value of 20 is used.
.IP MM
The month of the year, from 1 to 12.
.IP DD
The day of the month, from 1 to 31.
.IP hh
The hour of the day, from 0 to 23.
.IP mm
The minute of the hour, from 0 to 59.
.IP SS
The second of the minute, from 0 to 61.
.RE
.IP
If the "CC" and "YY" letter pairs are not specified, the values default
to the current year.  If the "SS" letter pair is not specified, the value
defaults to 0.
.IP \fB\-V\fR
Write the library version number to the standard output, and exit.
.IP \fB\-v\fR
Run in verbose mode.
.PP
In the case of catastrophic recovery, an archival copy - or
\fIsnapshot\fR - of all database files must be restored along with
all of the log files written since the database file snapshot was made.
(If disk space is a problem, log files may be referenced by symbolic
links). 
.PP
If the failure was not catastrophic, the files present on the system at the
time of failure are sufficient to perform recovery.
.PP
If log files are missing, db_recover will identify the missing
log file(s) and fail, in which case the missing log files need to be
restored and recovery performed again.
.PP
The db_recover utility uses a Berkeley DB environment (as described for the
\fB-h\fR option, the environment variable \fBDB_HOME\fR, or
because the utility was run in a directory containing a Berkeley DB
environment).  In order to avoid environment corruption when using a
Berkeley DB environment, db_recover should always be given the chance to
detach from the environment and exit gracefully.  To cause db_recover
to release all environment resources and exit cleanly, send it an
interrupt signal (SIGINT).
.PP
The db_recover utility exits 0 on success, and >0 if an error occurs.
.SH ENVIRONMENT
.IP \fBDB_HOME\fR
If the \fB-h\fR option is not specified and the environment variable
DB_HOME is set, it is used as the path of the database home, as described
in DB_ENV->open.
.SH AUTHORS
Sleepycat Software, Inc. This manual page was created based on
the HTML documentation for db_recover from Sleepycat,
by Thijs Kinkhorst <thijs@kinkhorst.com>,
for the Debian system (but may be used by others).
